import 'dart:convert';

class Area {
  String id, parentId, name, type;

  Area({this.id, this.parentId, this.name, this.type});

  factory Area.fromJson(Map<String, dynamic> data) {
    return Area(
      id: data['id'],
      parentId: data['parentId'],
      name: data['name'],
      type: data['type'],
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'parentId': parentId,
      'name': name,
      'type': type,
    };
  }

  @override
  String toString() {
    return json.encode(toMap());
  }
}
